﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HA.ModFlow.Infrastructure;

namespace HA.ModFlow.Domain.DomainLayer
{
    [Serializable]
   public class ModelOption:ICloneable
   {

        public ModelOption(DefaultParamForModFlow defaultParam,Units units)
        {
            _innerPack = INNERPACK.LPF;
            _solverPack = SOLVERPACK.SIP;
            
            _defaultParam = (DefaultParamForModFlow)defaultParam.Clone();
            _units = units;
        }



        #region 事件模型

        [field:NonSerialized]
        public event EventHandler InnerPackChanged;


        [field: NonSerialized]

        public event EventHandler SolverPackChanged;


        #endregion

        #region 流动包和解法包的选择

        INNERPACK _innerPack;

       public INNERPACK InnerPack
       {
           get { return _innerPack; }
           set {

               if (_innerPack!=value)
               {

                   _innerPack = value;

                   if (InnerPackChanged!=null)
                   {
                       InnerPackChanged(this,new EventArgs());
                       
                   }
                   
               }
              }
       }


       SOLVERPACK _solverPack;

       public SOLVERPACK SolverPack
       {
           get { return _solverPack; }
           set {


               if (_solverPack!=value)
               {

                   _solverPack = value;

                   if (SolverPackChanged!=null)
                   {
                       SolverPackChanged(this,new EventArgs ());
                       
                   }

                   
               }
              
           
           }
       }
        

       #endregion


       MODFLOWRUNTYPE _runType=MODFLOWRUNTYPE.STEADYSTATE;

        public MODFLOWRUNTYPE RunType
        {
            get { return _runType; }
            set { _runType = value; }
        }

        //单位选择
        Units _units;

        public Units Units
        {
            get { return _units; }
        }


        //TIME _time;

        //public TIME Time
        //{
        //    get { return _time; }
        //    set { _time = value; }
        //}

        //LENGTH _length;

        //public LENGTH Length
        //{
        //    get { return _length; }
        //    set { _length = value; }
        //}

        //系统默认值
        DefaultParamForModFlow _defaultParam;

        public DefaultParamForModFlow DefaultParam
        {
            get { return _defaultParam; }
        }
      

        public object Clone()
        {
            return this.MemberwiseClone();
        }


    }
}
